﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CoyoEden.Web.Controls;
using CoyoEden;
using CoyoEden.Models;

public partial class admin_Pages_Votes : AdminBasePage
{
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!Page.IsPostBack)
		{
			LoadCategoryList(ddlCategory);
			//add some js and css
			Utils.AddJavaScriptInclude(Utils.RelativeWebRoot+"assets/js/plugins/ui.datepicker-zh-CN.js",Page,true);
			Utils.AddJavaScriptInclude(Utils.RelativeWebRoot + "assets/js/plugins/flexigrid.js", Page, true);
			Utils.AddJavaScriptInclude(Utils.RelativeWebRoot+"admin/assets/js/Vote.js",Page,true);
			Utils.AddStylesheetInclude(Utils.RelativeWebRoot + "assets/css/flexigrid.css", Page, false);
		}
		Page.Title = "投票管理";
	}
	#region helper methods
	private void LoadCategoryList(DropDownList ddl)
	{
		// Load up the Parent DropDown
		ddl.ClearSelection();
		ddl.Items.Add(new ListItem("none", "-1"));
		foreach (Category c in Category.TopCategories)
		{
			ddl.Items.Add(new ListItem(c.Title, c.Id.ToString()));
		}
	}
	#endregion
}
